#! /bin/bash
#issue3.sh x 
#x代表数字
fun()
{ 
	for ((k=0;k<$1;k++))
	do 
		echo -n ' '
	done
}
read -p "please input data:" data
prev[0]=1
curr[0]=1 
fun $(((data-1)*2))
echo 1
for ((i=2; i<=data; i++))
do
	fun $(((data-i)*2)) 
  	curr[i]=1
  	printf '%-4d' ${curr[0]}
  	for ((j=1; j<i-1; j++))
	do
    		((curr[j]=prev[j-1]+prev[j]))
    		printf '%-4d' ${curr[j]}
  	done
  	printf '%-4d\n' ${curr[i]}
    	prev=(${curr[*]})
done
